import { createRouter, createWebHashHistory } from "vue-router";
import type { App } from "vue";
import routes from "./routes";
import { createRouterGuards } from "./router-guards"; // 添加路由守卫

const router = createRouter({
	history: createWebHashHistory(),
	routes: routes,
});

export function setupRouter(app: App) {
	app.use(router);
	// 创建路由守卫
	createRouterGuards(router);
}
